<?php
//fonction qui verifie si le pseudo existe
function verif_pseudo_existe($pseudo_user)
{
    require('connect_bdd.php');
    $sql="SELECT count(id_user) FROM users WHERE pseudo= :pseudo_user";
    $query=$connect->prepare($sql);
    $query->bindParam(':pseudo_user',$pseudo_user,PDO::PARAM_STR,35);
    $query->execute();
    $count_pseudo=$query->fetchColumn();
    return $count_pseudo;
}

//fonction qui verifie si l'email existe
function verif_email_existe($email_user)
{
    require('connect_bdd.php');
    $sql="SELECT count(id_user) FROM users WHERE email= :email_user";
    $query=$connect->prepare($sql);
    $query->bindParam(':email_user',$email_user,PDO::PARAM_STR,35);
    $query->execute();
    $count_email=$query->fetchColumn();
    return $count_email;
}
